
<% sim = @sell.total%>
<table align="right">
  <tr>
    <td ><strong>Simulate selling:</strong></td>
    <td align="right"><nobr>
       Quantity: <%= text_field 'sell', 'quantity', 'size' => '5'%></nobr></td>
    <td align="right"><nobr>Net Amount: <%= sprintf("%0.2f",-sim.net_amount) %></nobr></td>
  </tr>
  <tr>
    <td >&nbsp;</td>
    <td align="right"><nobr>Price: <%= text_field 'sell', 'price', 'size' => '5'  %></nobr></td>
    <td align="right"><nobr>Brokerage: <%= sprintf("%0.2f",sim.brokerage) %></nobr></td>
  </tr>
  <tr>
    <td >&nbsp;</td>
    <td align="right"><%= submit_tag "Calculate" %></td>
    <td align="right">Gross Amount: <%= sprintf("%0.2f",-sim.gross_amount) %>
       <span class="<%= totalColor(-sim.gross_amount - @operation.gross_amount)%>">
          (<%= sprintf("%+0.2f", (-sim.gross_amount - @operation.gross_amount)) %>)
        </span>
      </td>
  </tr>
</table>


